package com.ives.launcher.view;

import com.ives.launcher.logic.DragContainer;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

/**
 * 拖动过程中的view
 * 
 * @author ives
 * 
 */
public class View_Drag extends View {
	/**
	 * 自定义的布局管理器
	 */
	private View_Root.LayoutParams mPrams;
	/**
	 * 此拖动来自哪个cell
	 */
	private View_Cell startCell;
	/**
	 * 此拖动正在哪个容器进行
	 */
	private DragContainer draggingContainer;
	/**
	 * 拖动前属于哪个容器
	 */
	public DragContainer startGroup = null;

	public View_Drag(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public View_Drag(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public View_Drag(Context context) {
		super(context);
	}

	public boolean cloneCell(View_Drag drag) {
		if(drag==null)return false;
		try {
			drag.startCell = new View_Cell(drag.startCell);
			System.out.println("------");
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
	}

	public View_Root.LayoutParams getmPrams() {
		return mPrams;
	}

	public void setmPrams(View_Root.LayoutParams mPrams) {
		this.mPrams = mPrams;
	}

	public View_Cell getStartCell() {
		return startCell;
	}

	public void setStartCell(View_Cell startCell) {
		this.startCell = startCell;
	}

	public DragContainer getDraggingContainer() {
		return draggingContainer;
	}

	public void setDraggingContainer(DragContainer draggingContainer) {
		this.draggingContainer = draggingContainer;
	}

}
